import Vue from 'vue';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import VueMeta from 'vue-meta';
import {
  Row,
  Col,
  InputNumber,
  DatePicker,
  TimePicker,
  Button,
  Form,
  Card,
  Divider,
  FormItem,
  Option,
  Select,
  Input,
  Dialog,
  Tooltip,
  Upload,
  Step,
  Steps,
  Table,
  Loading,
  Pagination,
  TableColumn,
  Checkbox,
  CheckboxGroup,
  Radio,
  RadioGroup,
  TabPane,
  Tree,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Scrollbar,
  Popover,
  Popconfirm,
  Descriptions,
  DescriptionsItem,
  Alert,
  Link,
  Cascader,
} from 'element-ui';

/**
 * dayjs 启用扩展功能
 */
dayjs.extend(relativeTime);

if (typeof AbortController === 'undefined') {
  require('abortcontroller-polyfill/dist/polyfill-patch-fetch');
}

/**
 * 注册页面中使用到的所有的 第三方组件 / 自定义全局组件
 */
Vue.use(VueMeta)
  .use(Row)
  .use(Button)
  .use(Form)
  .use(Card)
  .use(Divider)
  .use(FormItem)
  .use(Option)
  .use(Select)
  .use(Input)
  .use(Dialog)
  .use(Col)
  .use(Tooltip)
  .use(InputNumber)
  .use(DatePicker)
  .use(Upload)
  .use(Step)
  .use(Steps)
  .use(Table)
  .use(TableColumn)
  .use(Loading)
  .use(Pagination)
  .use(Checkbox)
  .use(CheckboxGroup)
  .use(Radio)
  .use(RadioGroup)
  .use(TabPane)
  .use(Tree)
  .use(TimePicker)
  .use(Dropdown)
  .use(DropdownMenu)
  .use(DropdownItem)
  .use(Scrollbar)
  .use(Popover)
  .use(Popconfirm)
  .use(Descriptions)
  .use(DescriptionsItem)
  .use(Alert)
  .use(Link)
  .use(Cascader);
